//
//  LeftTableViewCell.m
//  Linkage
//
//  Created by LeeJay on 16/8/22.
//  Copyright © 2016年 LeeJay. All rights reserved.
//  代码下载地址https://github.com/leejayID/Linkage

#import "LeftTableViewCell.h"

#define defaultColor rgba(253, 212, 49, 1)

@interface LeftTableViewCell ()

@end

@implementation LeftTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        //设置背景色
        self.contentView.backgroundColor = rgba(244, 244, 244, 1.0);
        self.selectionStyle = UITableViewCellSelectionStyleNone; 
        self.nameLb = [UILabel new];
//        self.nameLb.numberOfLines = 0; //文字过多自动换行 //2019-2-25不容许自动换行
        
        self.nameLb.font = [UIFont systemFontOfSize:14.0];
        self.nameLb.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:self.nameLb];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self.nameLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state

    self.contentView.backgroundColor = selected ? [UIColor whiteColor] : [UIColor colorWithWhite:0 alpha:0.1];
    self.highlighted = selected;
    self.name.highlighted = selected;
}

@end
